import axios from 'axios';
import {ALL_SERVICE_API} from '../api';

export const createMessageTemplate = (params) => {
  return axios.post(ALL_SERVICE_API + '/message-templates', params);
};

export const updateMessageTemplate = (params) => {
  return axios.put(ALL_SERVICE_API + '/message-templates', params);
};

export const getAllMessageTemplates = (params) => {
  return axios.get(ALL_SERVICE_API + '/message-templates', {params: params});
};

export const getMessageTemplate = (id) => {
  return axios.get(ALL_SERVICE_API + '/message-templates/' + id);
};

export const deleteMessageTemplate = (id) => {
  return axios.delete(ALL_SERVICE_API + '/message-templates/' + id);
};

export const enableMessageTemplate = (id) => {
  return axios.put(ALL_SERVICE_API + '/message-templates/' + id + '/enable');
};

export const disableMessageTemplate = (id) => {
  return axios.put(ALL_SERVICE_API + '/message-templates/' + id + '/disable');
};
